feat(share): add public share-review API under OCP\Share\ShareReview#61543
Open
AndyScherzinger wants to merge 5 commits into
Open
feat(share): add public share-review API under OCP\Share\ShareReview#61543AndyScherzinger wants to merge 5 commits into
AndyScherzinger wants to merge 5 commits into
Conversation
Member
Author
|
/backport to stable34 |
CarlSchwan
reviewed
Jun 23, 2026
CarlSchwan
left a comment
Member
There was a problem hiding this comment.
Need to run build/autoloaderchecker.sh
c4ea0a9 to
af59b39
Compare
This was referenced Jun 25, 2026
f306220 to
d45d8e1
Compare
Member
Author
|
@provokateurin @CarlSchwan worked on addressing your review comments. |
d45d8e1 to
e46b015
Compare
provokateurin
requested changes
Jul 6, 2026
provokateurin
left a comment
Member
There was a problem hiding this comment.
Thanks for adding the explanation to the event docs.
Comment on lines
+36
to
+49
| * @return array<int, array{ | ||
| * id: string|int, | ||
| * object: string, | ||
| * initiator: string, | ||
| * type: int, | ||
| * recipient: string, | ||
| * permissions: int, | ||
| * time: string, | ||
| * action: string, | ||
| * timestamp?: int, | ||
| * password?: bool, | ||
| * expiration?: string, | ||
| * parent?: string|int | ||
| * }> Each share contains: |
Member
There was a problem hiding this comment.
This is not the same array shape that is used everywhere else. Either use exactly the same one or create a proper class to hold all these fields.
Comment on lines
+50
to
+59
| * id: The unique app-specific identifier for the share, passed to deleteShare(). | ||
| * object: The name or title of the object, such as a file path or report name. | ||
| * initiator: The user ID of the initiator. | ||
| * type: The OCP\Share\IShare type of the share. | ||
| * recipient: The user ID of the owner or the token of a link. | ||
| * permissions: The permissions level. Use 1 as the default if not set. | ||
| * time: The creation time. Use '1970-01-01 01:00:00' as the default if null. | ||
| * action: Optional deletion identifier override. Use an empty string to use id. | ||
| * password: Whether the share is password protected. Do not return the password itself. | ||
| * expiration: Optional expiration date displayed for the share. |
Member
There was a problem hiding this comment.
These descriptions can be inlined into the array type with // comment on a separate line before the line the comment is about.
Comment on lines
+18
to
+39
| /** @return class-string<IShareReviewSource> */ | ||
| private function makeSourceClass(string $name): string { | ||
| $source = new class($name) implements IShareReviewSource { | ||
| public function __construct( | ||
| private readonly string $name = '', | ||
| ) { | ||
| } | ||
|
|
||
| public function getName(): string { | ||
| return $this->name; | ||
| } | ||
|
|
||
| public function getShares(): array { | ||
| return []; | ||
| } | ||
|
|
||
| public function deleteShare(string $shareId): bool { | ||
| return false; | ||
| } | ||
| }; | ||
| return $source::class; | ||
| } |
Introduces OCP\Share\Events\ShareReviewAccessCheckEvent as the canonical authorization gate event for ShareReview sources. The event carries the source name and share ID for listener context, implements deny-wins semantics, and stops propagation immediately on denial. Assisted-by: ClaudeCode:claude-sonnet-4-6 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…re\ShareReview Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
…ssCheckEvent Assisted-by: Claude Code:claude-fable-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Assisted-by: ClaudeCode:claude-fable-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
e46b015 to
fa57f02
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces
OCP\Share\Events\ShareReviewAccessCheckEventas the canonical authorization gate event for ShareReview sources. The event carries the source name and share ID for listener context, implements deny-wins semantics, and stops propagation immediately on denial.This is a discussed and agreed on measure to safeguard auditing-triggered share deletions throughout various apps using a "check back event mechanism", so apps can implement their support for this (any app that has shares basically, of any kind)
Docs at nextcloud/documentation#15223
Assisted-by: Claude Code:claude-sonnet-4-6
and
Assisted-by: Claude Code:claude-fable-5
TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)